/**
 * Created with IntelliJ IDEA.
 * Description:
 */
class Text{
    private boolean isFalse =false;

    public boolean isFalse() {
        return isFalse;
    }

    public void setFalse(boolean aFalse) {
        isFalse = aFalse;
    }
}
public class Demo7 {
    public static void main(String[] args) throws InterruptedException {
        Text text =new Text();
        Thread thread =new Thread(()->{
            while(!text.isFalse()){
                System.out.println("thread线程");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
        thread.start();
        Thread.sleep(3000);
        text.setFalse(true);
//        text = new Text();
    }
}
